<% # @page_title="Host Information" %>
<% @mselect_windowshostinfo=1 %>
<% @table = @windows_host_infos %>
<% @action = "index" %>
<% @cont = "windows_host_infos" %>

<%= render :partial => 'layouts/page_count' %>

<table>
<thead>
  <tr>
    <th scope="col">      
      <%= sort_link("Test Area", "session_test_area") %>
      <%= filterx_icon("Remove filter on #{session[:test_area]}", session[:test_area], :test_area, {:controller => 'test_areas', :action => 'set', :id => 'all'}) %>
    </th>

    <th scope="col"><%= sort_link("IP", "ip_address") %>
      <%= filterx_icon("Remove filter on host", @url_params[:host_id_v], :host_id_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Hostname", "hostname") %>
      <%= filterx_icon("Remove filter on hostname", @url_params[:hostname_v], :hostname_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Dom Name", "dom_name") %>
      <%= filterx_icon("Remove filter on Dom Name", @url_params[:dom_name_v], :dom_name_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Long Dom Name", "windows_long_dom") %>
      <%= filterx_icon("Remove filter on Dom Name", @url_params[:windows_long_dom_v], :windows_long_dom_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Member Of", "member_of") %>
      <%= filterx_icon("Remove filter on member_of", @url_params[:member_of_v], :member_of_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("DC?", "dc") %>
      <%= filterx_icon("Remove filter on #{@url_params[:dc_v]}", @url_params[:dc_v], :dc_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("OS", "os") %>
      <%= filterx_icon("Remove filter on #{@url_params[:os_v]}", @url_params[:os_v], :os_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("SMB Server Version", "smb_server_version") %>
      <%= filterx_icon("Remove filter on smb_server_version", @url_params[:smb_server_version_v], :smb_server_version_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Domain SID", "domain_sid") %>
      <%= filterx_icon("Remove filter on domain_sid", @url_params[:domain_sid_v], :domain_sid_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("Pwd Cplx Flgs", "pwd_complexity_flags") %>
      <%= filterx_icon("Remove filter on pwd_complexity_flags", @url_params[:pwd_complexity_flags_v], :pwd_complexity_flags_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("LO Thresh", "lockout_threshold") %>
      <%= filterx_icon("Remove filter on lockout_threshold", @url_params[:lockout_threshold_v], :lockout_threshold_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("LO Dur", "lockout_duration") %>
      <%= filterx_icon("Remove filter on lockout_duration", @url_params[:lockout_duration_v], :lockout_duration_v, {:controller => @cont}) %>
    </th>

    <th scope="col"><%= sort_link("LO Ctr Rst", "reset_lockout_ctr") %>
      <%= filterx_icon("Remove filter on reset_lockout_ctr", @url_params[:reset_lockout_ctr_v], :reset_lockout_ctr_v, {:controller => @cont}) %>
    </th>

  </tr>
</thead>

<tbody>
<%
odd_or_even = 0
for windows_host_info in @windows_host_infos
    odd_or_even = 1 - odd_or_even
%>
  <tr class="odd<%=h odd_or_even %>">
    <td>
       <%=h windows_host_info.test_area_name %>
       <%= filter_icon("Show only #{windows_host_info.test_area_name}", session[:test_area], {:controller => 'test_areas', :action => 'set', :id => windows_host_info.test_area_id}) %>
    </td>

    <td><%= link_to_host(windows_host_info.ip_address, {:controller => "hosts", :action => "showhostinfo", :id => windows_host_info.host_id}) %></td>

    <td>
       <%=h windows_host_info.hostname %> 
       <%= filter_icon("Show only #{windows_host_info.hostname}", @url_params[:hostname_v], {:controller => 'windows_host_infos', :hostname_v => windows_host_info.hostname}) %>
    </td>

    <td>
       <%=h windows_host_info.dom_name %> 
       <%= filter_icon("Show only #{windows_host_info.dom_name }", @url_params[:dom_name_v], {:controller => 'windows_host_infos', :dom_name_v => windows_host_info.dom_name}) %>
    </td>

    <td>
       <%=h windows_host_info.windows_long_dom %> 
       <%= filter_icon("Show only #{windows_host_info.windows_long_dom }", @url_params[:windows_long_dom_v], {:controller => 'windows_host_infos', :windows_long_dom_v => windows_host_info.windows_long_dom}) %>
    </td>

    <td>
       <%=h windows_host_info.member_of %> 
       <%= filter_icon("Show only #{windows_host_info.member_of }", @url_params[:member_of_v], {:controller => 'windows_host_infos', :member_of_v => windows_host_info.member_of}) %>
    </td>

    <td>
       <%=h windows_host_info.dc %> 
       <%= filter_icon("Show only #{windows_host_info.dc}", @url_params[:dc_v], {:controller => 'windows_host_infos', :dc_v => windows_host_info.dc}) %>
    </td>

    <td>
       <%=h yt_truncate(windows_host_info.os,100) %>
       <%= filter_icon("Show only #{windows_host_info.os}", @url_params[:os_v], {:controller => 'windows_host_infos', :os_v => windows_host_info.os}) %>
    </td>

    <td>
       <%=h windows_host_info.smb_server_version %> 
       <%= filter_icon("Show only #{windows_host_info.smb_server_version }", @url_params[:smb_server_version_v], {:controller => 'windows_host_infos', :smb_server_version_v => windows_host_info.smb_server_version}) %>
    </td>

    <td>
       <%=h windows_host_info.domain_sid %> 
       <%= filter_icon("Show only #{windows_host_info.domain_sid }", @url_params[:domain_sid_v], {:controller => 'windows_host_infos', :domain_sid_v => windows_host_info.domain_sid}) %>
    </td>

    <td>
       <%=h windows_host_info.pwd_complexity_flags %> 
       <%= filter_icon("Show only #{windows_host_info.pwd_complexity_flags }", @url_params[:pwd_complexity_flags_v], {:controller => 'windows_host_infos', :pwd_complexity_flags_v => windows_host_info.pwd_complexity_flags}) %>
    </td>

    <td>
       <%=h windows_host_info.lockout_threshold %> 
       <%= filter_icon("Show only #{windows_host_info.lockout_threshold }", @url_params[:lockout_threshold_v], {:controller => 'windows_host_infos', :lockout_threshold_v => windows_host_info.lockout_threshold}) %>
    </td>

    <td>
       <%=h windows_host_info.lockout_duration %> 
       <%= filter_icon("Show only #{windows_host_info.lockout_duration }", @url_params[:lockout_duration_v], {:controller => 'windows_host_infos', :lockout_duration_v => windows_host_info.lockout_duration}) %>
    </td>

    <td>
       <%=h windows_host_info.reset_lockout_ctr %> 
       <%= filter_icon("Show only #{windows_host_info.reset_lockout_ctr }", @url_params[:reset_lockout_ctr_v], {:controller => 'windows_host_infos', :reset_lockout_ctr_v => windows_host_info.reset_lockout_ctr}) %>
    </td>

  </tr>
<% end %>
</tbody>
</table>

<%= render :partial => 'layouts/page_count' %>
